package org.example.distributedlock.controller;

import org.example.distributedlock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("stock")
public class StockController {

    @Autowired
    StockService stockService;


    @GetMapping("deduct")
    public String deduct() {
        stockService.deduct();

        return "deduct count -1";
    }

}
